package vip.george.common.exception;

import vip.george.common.constant.ResultCodeEnum;

/**
 * @author george
 * @since 2023/7/5
 * <p>自定义业务异常</p>
 */
public class AppException extends RuntimeException{

    private ResultCodeEnum resultCodeEnum;

    /**
     * 通过错误码枚举抛出异常，由统一异常进行捕获
     * @param resultCodeEnum
     */
    public AppException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.resultCodeEnum = resultCodeEnum;
    }


    public ResultCodeEnum getResultCodeEnum() {
        return resultCodeEnum;
    }


}
